package com.ztgf.order.mapper;

import com.ztgf.commodity.models.dto.CommoditySpecificationRelationDTO;
import com.ztgf.order.models.vo.OrderCommodityVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * author: chenyu.wang
 * date: 2020-06-23 10:34
 * Description:订单商品mapper
 */
@Mapper
public interface OrderCommodiytMapper {

    /**
     * description: 根据买家店铺id和卖家店铺id查询会员折扣
     * param: [sellShopId, buyShopId]
     * author: chenyu.wang
     * date: 2020-06-23
     * return: java.math.BigDecimal
     */
    BigDecimal getMemberDiscount(@Param("sellShopId") Long sellShopId, @Param("buyShopId") Long buyShopId);

    /**
     * description: 根据商品id和规格ids查询具体价格信息
     * param: [goodsId, atrrIds]
     * author: chenyu.wang
     * date: 2020-06-23
     * return: com.ztgf.order.models.vo.OrderCommodityVO
     */
    OrderCommodityVO queryCommoditySpecPrice(@Param("goodsId") Long goodsId, @Param("atrrIds") String atrrIds);

    /**
     * description: 根据商品id和套餐id，查询商品套餐价格
     * param: [comboId, goodsId]
     * author: chenyu.wang
     * date: 2020-06-23
     * return: com.ztgf.order.models.vo.OrderCommodityVO
     */
    OrderCommodityVO queryComodityComboPrice(@Param("comboId") String comboId, @Param("goodsId") Long goodsId);

    /**
     * description: 查询商品规格库存
     * param: [attrIds, goodsId]
     * author: chenyu.wang
     * date: 2020-06-24
     * return: java.lang.Integer
     */
    Integer queryGoodsAttrInventoryNumber(@Param("attrIds") String attrIds, @Param("goodsId") Long goodsId);

    /**
     * description: 查询商品套餐库存
     * param: [comboId, goodsId]
     * author: chenyu.wang
     * date: 2020-06-24
     * return: java.lang.Integer
     */
    Integer queryGoodsComboInventoryNumber(@Param("comboId") Long comboId, @Param("goodsId") Long goodsId);

}
